#define  _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
#include<algorithm>


using namespace std;

class Solution {
public:
    string multiply(string num1, string num2)
    {
        int i = num1.size() - 1;
        int j = num2.size() - 1;
        int next = 0;
        string s;
        while (i >= 0 && j >= 0)
        {
            int val1 = num1[i--] - '0';
            int val2 = num2[j--] - '0';
            int ret = val1 * val2 + next;
            next = ret / 10;
            ret = ret % 10;
            s += ret + '0';

        }
        while (i >= 0)
        {
            s += (num1[i] + next);
            if ((num1[i] - '0' + next) >= 10)
                next = (num1[i--] - '0' + next) % 10;
        }
        while (j >= 0)
        {
            s += (num2[j] + next);
            if ((num2[j] - '0' + next) >= 10)
                next = (num2[j--] - '0' + next) % 10;

        }
        if (i == 0 && j == 0)
        {
            s += next + '0';
        }
        reverse(s.begin(), s.end());
        return s;
    }
};


void vector_test01()
{
    vector<int> v;
    v.push_back(1);
    v.push_back(2);
    v.push_back(3);
    v.push_back(4);
    v.push_back(5);
    for (size_t i = 0; i < v.size(); i++)
    {
        cout << v[i] << " ";
    }
    cout << endl;

    vector<int>::iterator it = v.begin();
    while (it != v.end())
    {
        cout << *it;
        ++it;
    }
    cout << endl;

    for (auto e : v)
    {
        cout << e;
    }
    cout << endl;
}

void vector_test02()
{
    vector<int> v = { 1,2,3,6,7 };
    //greater<int> gt;
    sort(v.begin(), v.end(),greater<int>());
    for (auto e : v)
    {
        cout << e << " ";
    }
    cout << endl;

}

int main()
{
    /*string s1;
    string s2;
    s1 += "123";
    s2 += "456";
    Solution().multiply(s1,s2);
    return 0;*/
    //vector_test01();
    vector_test02();
}

